package com.itheima.udp1;

import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.InetAddress;

/**
 * @author Anomaly
 * @date 2023/2/11 13:50
 */
public class Client {
    public static void main(String[] args) throws Exception {
        System.out.println("==============客户端启动=================");
        DatagramSocket socket = new DatagramSocket();
        byte[] buffer = "海贼王1074，五档副作用开始透支路飞生命，罗究竟还是要牺牲自己".getBytes();
        DatagramPacket packet = new DatagramPacket(buffer, buffer.length, InetAddress.getLocalHost(), 8888);
        socket.send(packet);
        System.out.println("客户端发送了消息。。。");
        socket.close();
    }
}
